# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : 简单提示词模板使用.py
# @Author: dongguangwen
# @Date  : 2025-03-23 16:10
from langchain_core.prompts import ChatPromptTemplate


system_template = "Translate the following into {language}:"
prompt_template = ChatPromptTemplate.from_messages(
    [("system", system_template), ("user", "{text}")]
)

result = prompt_template.invoke({"language": "italian", "text": "hi"})
print(result)

print(result.to_messages())

"""
messages=[SystemMessage(content='Translate the following into italian:', additional_kwargs={}, response_metadata={}), HumanMessage(content='hi', additional_kwargs={}, response_metadata={})]
[SystemMessage(content='Translate the following into italian:', additional_kwargs={}, response_metadata={}), HumanMessage(content='hi', additional_kwargs={}, response_metadata={})]
"""
